home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / 3dlib15.zip / HDR3D.PAS < prev    next >
Pascal/Delphi Source File  |  1992-10-27  |  3KB  |  84 lines

  1. (******************************************************************************
  2. *                                    hdr3d                                    *
  3. * This unit includes the headers needed for 3D manipulation ..                *
  4. ******************************************************************************)
  5. unit hdr3d;
  6.  
  7. interface
  8.  
  9. const
  10.     MaxPoints  = 20;
  11.     MaxLines   = 50;
  12.     maxObjects = 9; {size of object table}
  13.     maxNest    = 10; {size of loop table of interpreter}
  14.  
  15. const ScreenWidth = 1000;
  16.       HalfWidth   = screenWidth / 2;
  17.  
  18.       radFactor = 180 / 3.1415926535897932385;
  19.  
  20. type
  21.     Line3d  = record
  22.        FromP, ToP  : integer;
  23.     end;
  24.     screenPoints = record
  25.        sX,sY : integer;
  26.     end;
  27.     axisType = (x,y,z);
  28.  
  29. type
  30.     point3d = record
  31.        x, y, z     : real;
  32.     end;
  33.  
  34. const
  35.        zeroPoint : point3d = (x:0.0; y:0.0; z:0.0);
  36.        xAxis : integer = 45;
  37.        yAxis : integer = 45;
  38.  
  39. var
  40.        cosine_x,cosine_y,sine_x,sine_y : Real;
  41.        currentPath : string[32];
  42. const
  43.        currentAxis : axisType = x;
  44.  
  45.  
  46. Procedure CalcAxisDeg;
  47. procedure setDefaultSuffix(var Fname : string; suffix : string);
  48.  
  49. implementation
  50.  
  51. (******************************************************************************
  52. *                                 CalcAxisDeg                                 *
  53. * calculate sines and cosines of axis, xAxis + yAxis = 90 !                   *
  54. ******************************************************************************)
  55. Procedure CalcAxisDeg;
  56. begin
  57.      Cosine_X := cos(Xaxis/RadFactor);
  58.      Cosine_Y := cos(Yaxis/RadFactor);
  59.      Sine_X   := sin(Xaxis/RadFactor);
  60.      Sine_Y   := sin(Yaxis/RadFactor);
  61. end; {calcAxisDeg}
  62.  
  63. (*******************************************************************************
  64. *                              setDefaultSuffix                                *
  65. *   Set the suffix if Fname to .suffix, if it does not have a suffix           *
  66. *******************************************************************************)
  67. procedure setDefaultSuffix;
  68. var
  69.     i  : integer;
  70. begin
  71.     i := length(Fname);
  72.     while (i > 0) and (Fname[i] <> '.') do
  73.        dec(i);
  74.     if (i = 0) then
  75.        Fname := Fname + '.' + suffix;
  76. end; {setDefaultSuffix}
  77.  
  78. (******************************************************************************
  79. *                                    end.                                     *
  80. ******************************************************************************)
  81. begin
  82.        calcAxisDeg;
  83. end.
  84.